<?xml version="1.0" encoding="UTF-8"?>
<dxl:DXLMessage xmlns:dxl="http://greenplum.com/dxl/2010/12/">
  <dxl:Comment><![CDATA[
      Objective: Test for a range type with a subtype that supports hashing, ORCA
      generates a HASH JOIN plan.

      create type intrange as range (subtype = int);
      select '(2,5)'::intrange except select '(5,6)'::intrange;

      GroupAggregate  (cost=0.00..0.00 rows=1 width=8)
        Group Key: ('(2,5)'::intrange)
        ->  Sort  (cost=0.00..0.00 rows=1 width=8)
              Sort Key: ('(2,5)'::intrange)
              ->  Hash Anti Join  (cost=0.00..0.00 rows=1 width=8)
                    Hash Cond: (NOT ((('(2,5)'::intrange))::anyrange IS DISTINCT FROM (('(5,6)'::intrange))::anyrange))
                    ->  Result  (cost=0.00..0.00 rows=1 width=1)
                    ->  Hash  (cost=0.00..0.00 rows=1 width=8)
                          ->  Result  (cost=0.00..0.00 rows=1 width=1)
  ]]>
  </dxl:Comment>
  <dxl:Thread Id="0">
    <dxl:OptimizerConfig>
      <dxl:EnumeratorConfig Id="0" PlanSamples="0" CostThreshold="0"/>
      <dxl:StatisticsConfig DampingFactorFilter="0.750000" DampingFactorJoin="0.000000" DampingFactorGroupBy="0.750000" MaxStatsBuckets="100"/>
      <dxl:CTEConfig CTEInliningCutoff="0"/>
      <dxl:WindowOids RowNumber="3100" Rank="3101"/>
      <dxl:CostModelConfig CostModelType="1" SegmentsForCosting="3">
        <dxl:CostParams>
          <dxl:CostParam Name="NLJFactor" Value="1024.000000" LowerBound="1023.500000" UpperBound="1024.500000"/>
        </dxl:CostParams>
      </dxl:CostModelConfig>
      <dxl:Hint JoinArityForAssociativityCommutativity="18" ArrayExpansionThreshold="100" JoinOrderDynamicProgThreshold="10" BroadcastThreshold="100000" EnforceConstraintsOnDML="false" PushGroupByBelowSetopThreshold="10" XformBindThreshold="0" SkewFactor="0"/>
      <dxl:TraceFlags Value="102074,102120,102146,102155,102156,103001,103003,103014,103022,103027,103029,103038,103041,104002,104003,104004,104005,105000,106000"/>
    </dxl:OptimizerConfig>
    <dxl:Metadata SystemIds="0.GPDB">
      <dxl:Type Mdid="0.16.1.0" Name="bool" IsRedistributable="true" IsHashable="true" IsMergeJoinable="true" IsComposite="false" IsTextRelated="false" IsFixedLength="true" Length="1" PassByValue="true">
        <dxl:DistrOpfamily Mdid="0.2222.1.0"/>
        <dxl:LegacyDistrOpfamily Mdid="0.7124.1.0"/>
        <dxl:EqualityOp Mdid="0.91.1.0"/>
        <dxl:InequalityOp Mdid="0.85.1.0"/>
        <dxl:LessThanOp Mdid="0.58.1.0"/>
        <dxl:LessThanEqualsOp Mdid="0.1694.1.0"/>
        <dxl:GreaterThanOp Mdid="0.59.1.0"/>
        <dxl:GreaterThanEqualsOp Mdid="0.1695.1.0"/>
        <dxl:ComparisonOp Mdid="0.1693.1.0"/>
        <dxl:ArrayType Mdid="0.1000.1.0"/>
        <dxl:MinAgg Mdid="0.0.0.0"/>
        <dxl:MaxAgg Mdid="0.0.0.0"/>
        <dxl:AvgAgg Mdid="0.0.0.0"/>
        <dxl:SumAgg Mdid="0.0.0.0"/>
        <dxl:CountAgg Mdid="0.2147.1.0"/>
      </dxl:Type>
      <dxl:GPDBScalarOp Mdid="0.3882.1.0" Name="=" ComparisonType="Eq" ReturnsNullOnNullInput="true" IsNDVPreserving="false">
        <dxl:LeftType Mdid="0.3831.1.0"/>
        <dxl:RightType Mdid="0.3831.1.0"/>
        <dxl:ResultType Mdid="0.16.1.0"/>
        <dxl:OpFunc Mdid="0.3855.1.0"/>
        <dxl:Commutator Mdid="0.3882.1.0"/>
        <dxl:InverseOp Mdid="0.3883.1.0"/>
        <dxl:HashOpfamily Mdid="0.3903.1.0"/>
        <dxl:Opfamilies>
          <dxl:Opfamily Mdid="0.3474.1.0"/>
          <dxl:Opfamily Mdid="0.3901.1.0"/>
          <dxl:Opfamily Mdid="0.3903.1.0"/>
          <dxl:Opfamily Mdid="0.3919.1.0"/>
        </dxl:Opfamilies>
      </dxl:GPDBScalarOp>
      <dxl:GPDBScalarOp Mdid="0.3884.1.0" Name="&lt;" ComparisonType="LT" ReturnsNullOnNullInput="true" IsNDVPreserving="false">
        <dxl:LeftType Mdid="0.3831.1.0"/>
        <dxl:RightType Mdid="0.3831.1.0"/>
        <dxl:ResultType Mdid="0.16.1.0"/>
        <dxl:OpFunc Mdid="0.3871.1.0"/>
        <dxl:Commutator Mdid="0.3887.1.0"/>
        <dxl:InverseOp Mdid="0.3886.1.0"/>
        <dxl:Opfamilies>
          <dxl:Opfamily Mdid="0.3901.1.0"/>
        </dxl:Opfamilies>
      </dxl:GPDBScalarOp>
      <dxl:GPDBScalarOp Mdid="0.3887.1.0" Name="&gt;" ComparisonType="GT" ReturnsNullOnNullInput="true" IsNDVPreserving="false">
        <dxl:LeftType Mdid="0.3831.1.0"/>
        <dxl:RightType Mdid="0.3831.1.0"/>
        <dxl:ResultType Mdid="0.16.1.0"/>
        <dxl:OpFunc Mdid="0.3874.1.0"/>
        <dxl:Commutator Mdid="0.3884.1.0"/>
        <dxl:InverseOp Mdid="0.3885.1.0"/>
        <dxl:Opfamilies>
          <dxl:Opfamily Mdid="0.3901.1.0"/>
        </dxl:Opfamilies>
      </dxl:GPDBScalarOp>
      <dxl:MDCast Mdid="3.3831.1.0;3831.1.0" Name="anyrange" BinaryCoercible="true" SourceTypeId="0.3831.1.0" DestinationTypeId="0.3831.1.0" CastFuncId="0.0.0.0" CoercePathType="0"/>
      <dxl:Type Mdid="0.82272.1.0" Name="intrange" IsRedistributable="true" IsHashable="true" IsMergeJoinable="true" IsComposite="false" IsTextRelated="false" IsFixedLength="false" Length="-1" PassByValue="false">
        <dxl:DistrOpfamily Mdid="0.3903.1.0"/>
        <dxl:EqualityOp Mdid="0.3882.1.0"/>
        <dxl:InequalityOp Mdid="0.3883.1.0"/>
        <dxl:LessThanOp Mdid="0.3884.1.0"/>
        <dxl:LessThanEqualsOp Mdid="0.3885.1.0"/>
        <dxl:GreaterThanOp Mdid="0.3887.1.0"/>
        <dxl:GreaterThanEqualsOp Mdid="0.3886.1.0"/>
        <dxl:ComparisonOp Mdid="0.3870.1.0"/>
        <dxl:ArrayType Mdid="0.82273.1.0"/>
        <dxl:MinAgg Mdid="0.0.0.0"/>
        <dxl:MaxAgg Mdid="0.0.0.0"/>
        <dxl:AvgAgg Mdid="0.0.0.0"/>
        <dxl:SumAgg Mdid="0.0.0.0"/>
        <dxl:CountAgg Mdid="0.2147.1.0"/>
      </dxl:Type>
      <dxl:MDCast Mdid="3.82272.1.0;3831.1.0" Name="anyrange" BinaryCoercible="true" SourceTypeId="0.82272.1.0" DestinationTypeId="0.3831.1.0" CastFuncId="0.0.0.0" CoercePathType="0"/>
    </dxl:Metadata>
    <dxl:Query>
      <dxl:OutputColumns>
        <dxl:Ident ColId="2" ColName="intrange" TypeMdid="0.82272.1.0"/>
      </dxl:OutputColumns>
      <dxl:CTEList/>
      <dxl:Difference InputColumns="2;4" CastAcrossInputs="false">
        <dxl:Columns>
          <dxl:Column ColId="2" Attno="1" ColName="intrange" TypeMdid="0.82272.1.0"/>
        </dxl:Columns>
        <dxl:LogicalProject>
          <dxl:ProjList>
            <dxl:ProjElem ColId="2" Alias="intrange">
              <dxl:ConstValue TypeMdid="0.82272.1.0" Value="AAAAEWBBAQACAAAABQAAAAA="/>
            </dxl:ProjElem>
          </dxl:ProjList>
          <dxl:LogicalConstTable>
            <dxl:Columns>
              <dxl:Column ColId="1" Attno="1" ColName="" TypeMdid="0.16.1.0"/>
            </dxl:Columns>
            <dxl:ConstTuple>
              <dxl:Datum TypeMdid="0.16.1.0" Value="true"/>
            </dxl:ConstTuple>
          </dxl:LogicalConstTable>
        </dxl:LogicalProject>
        <dxl:LogicalProject>
          <dxl:ProjList>
            <dxl:ProjElem ColId="4" Alias="intrange">
              <dxl:ConstValue TypeMdid="0.82272.1.0" Value="AAAAEWBBAQAFAAAABgAAAAA="/>
            </dxl:ProjElem>
          </dxl:ProjList>
          <dxl:LogicalConstTable>
            <dxl:Columns>
              <dxl:Column ColId="3" Attno="1" ColName="" TypeMdid="0.16.1.0"/>
            </dxl:Columns>
            <dxl:ConstTuple>
              <dxl:Datum TypeMdid="0.16.1.0" Value="true"/>
            </dxl:ConstTuple>
          </dxl:LogicalConstTable>
        </dxl:LogicalProject>
      </dxl:Difference>
    </dxl:Query>
    <dxl:Plan Id="0" SpaceSize="120">
      <dxl:Aggregate AggregationStrategy="Sorted" StreamSafe="false">
        <dxl:Properties>
          <dxl:Cost StartupCost="0" TotalCost="0.000519" Rows="1.000000" Width="8"/>
        </dxl:Properties>
        <dxl:GroupingColumns>
          <dxl:GroupingColumn ColId="1"/>
        </dxl:GroupingColumns>
        <dxl:ProjList>
          <dxl:ProjElem ColId="1" Alias="intrange">
            <dxl:Ident ColId="1" ColName="intrange" TypeMdid="0.82272.1.0"/>
          </dxl:ProjElem>
        </dxl:ProjList>
        <dxl:Filter/>
        <dxl:Sort SortDiscardDuplicates="false">
          <dxl:Properties>
            <dxl:Cost StartupCost="0" TotalCost="0.000506" Rows="1.000000" Width="8"/>
          </dxl:Properties>
          <dxl:ProjList>
            <dxl:ProjElem ColId="1" Alias="intrange">
              <dxl:Ident ColId="1" ColName="intrange" TypeMdid="0.82272.1.0"/>
            </dxl:ProjElem>
          </dxl:ProjList>
          <dxl:Filter/>
          <dxl:SortingColumnList>
            <dxl:SortingColumn ColId="1" SortOperatorMdid="0.3884.1.0" SortOperatorName="&lt;" SortNullsFirst="false"/>
          </dxl:SortingColumnList>
          <dxl:LimitCount/>
          <dxl:LimitOffset/>
          <dxl:HashJoin JoinType="LeftAntiSemiJoin">
            <dxl:Properties>
              <dxl:Cost StartupCost="0" TotalCost="0.000506" Rows="1.000000" Width="8"/>
            </dxl:Properties>
            <dxl:ProjList>
              <dxl:ProjElem ColId="1" Alias="intrange">
                <dxl:Ident ColId="1" ColName="intrange" TypeMdid="0.82272.1.0"/>
              </dxl:ProjElem>
            </dxl:ProjList>
            <dxl:Filter/>
            <dxl:JoinFilter/>
            <dxl:HashCondList>
              <dxl:Not>
                <dxl:IsDistinctFrom OperatorMdid="0.3882.1.0">
                  <dxl:Cast TypeMdid="0.3831.1.0" FuncId="0.0.0.0">
                    <dxl:Ident ColId="1" ColName="intrange" TypeMdid="0.82272.1.0"/>
                  </dxl:Cast>
                  <dxl:Cast TypeMdid="0.3831.1.0" FuncId="0.0.0.0">
                    <dxl:Ident ColId="3" ColName="intrange" TypeMdid="0.82272.1.0"/>
                  </dxl:Cast>
                </dxl:IsDistinctFrom>
              </dxl:Not>
            </dxl:HashCondList>
            <dxl:Result>
              <dxl:Properties>
                <dxl:Cost StartupCost="0" TotalCost="0.000009" Rows="1.000000" Width="8"/>
              </dxl:Properties>
              <dxl:ProjList>
                <dxl:ProjElem ColId="1" Alias="intrange">
                  <dxl:ConstValue TypeMdid="0.82272.1.0" Value="AAAAEWBBAQACAAAABQAAAAA="/>
                </dxl:ProjElem>
              </dxl:ProjList>
              <dxl:Filter/>
              <dxl:OneTimeFilter/>
              <dxl:Result>
                <dxl:Properties>
                  <dxl:Cost StartupCost="0" TotalCost="0.000001" Rows="1.000000" Width="1"/>
                </dxl:Properties>
                <dxl:ProjList>
                  <dxl:ProjElem ColId="0" Alias="">
                    <dxl:ConstValue TypeMdid="0.16.1.0" Value="true"/>
                  </dxl:ProjElem>
                </dxl:ProjList>
                <dxl:Filter/>
                <dxl:OneTimeFilter/>
              </dxl:Result>
            </dxl:Result>
            <dxl:Result>
              <dxl:Properties>
                <dxl:Cost StartupCost="0" TotalCost="0.000009" Rows="1.000000" Width="8"/>
              </dxl:Properties>
              <dxl:ProjList>
                <dxl:ProjElem ColId="3" Alias="intrange">
                  <dxl:ConstValue TypeMdid="0.82272.1.0" Value="AAAAEWBBAQAFAAAABgAAAAA="/>
                </dxl:ProjElem>
              </dxl:ProjList>
              <dxl:Filter/>
              <dxl:OneTimeFilter/>
              <dxl:Result>
                <dxl:Properties>
                  <dxl:Cost StartupCost="0" TotalCost="0.000001" Rows="1.000000" Width="1"/>
                </dxl:Properties>
                <dxl:ProjList>
                  <dxl:ProjElem ColId="2" Alias="">
                    <dxl:ConstValue TypeMdid="0.16.1.0" Value="true"/>
                  </dxl:ProjElem>
                </dxl:ProjList>
                <dxl:Filter/>
                <dxl:OneTimeFilter/>
              </dxl:Result>
            </dxl:Result>
          </dxl:HashJoin>
        </dxl:Sort>
      </dxl:Aggregate>
    </dxl:Plan>
  </dxl:Thread>
</dxl:DXLMessage>
